package com.itheima.d4.DateTimeFormatter;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;

public class Test {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.now();
        DateTimeFormatter dt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = dt.format(localDateTime);
        System.out.println(format);
        String s ="2021-11-12 14:45:34";
        LocalDateTime parse = LocalDateTime.parse(s, dt);
        System.out.println(parse);
    }
}
